<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>Happy ERP</title>
    <%= stylesheet_link_tag "../javascripts/ext/resources/css/ext-all.css" %>
    <%= stylesheet_link_tag "/stylesheets/tasks.css" %>
    <%= stylesheet_link_tag "/stylesheets/images.css" %>

    <%= javascript_include_tag "ext/adapter/ext/ext-base.js" %>
    <%= javascript_include_tag "ext/ext-all-debug.js" %>
    <%= javascript_include_tag "ext/src/locale/ext-lang-zh_CN.js" %>


    <script type="text/javascript">
      Ext.onReady(function(){
        // shorthand
        var tree = new Ext.tree.TreePanel({
          el:'tree-div',
          rootVisible:false,
          useArrows:false,
          frame: false,
          loader: new Ext.tree.TreeLoader({dataUrl:'/test/getTreeData'})
        });
        var root = new Ext.tree.TreeNode({text:'我是根'});
        var branch = new Ext.tree.TreeNode({text:'我不是根'});
        var branch1 = new Ext.tree.TreeNode({text:'我也不是根'});
        root.appendChild(branch);
        root.appendChild(branch1);
        tree.setRootNode(root);
        tree.render();
      })
    </script>
  </head>
  <body>    
    <div id="tree-div"></div>
  </body>
</html>
